<?php
include_once 'conn.php';
$username = $_POST['username'];
$pw = md5($_POST['pw']);
$email = $_POST['email'];
$nickname = $_POST['nickname'];
$filename = $_POST['filename'];
$birthday = $_POST['birthday'];
$sql = "insert into userinfo (username, nickname, email, birthday, pic,  pw,  postDate) values ('$username','$nickname','$email','$birthday','$filename','$pw','".date('Y-m-d H:i:s')."')";
$result = mysqli_query($conn,$sql);
if($result){
    $a['error'] = 0;
}
else{
    $a['error'] = 1;
    $a['errMsg'] = '注册失败';
}
$a['sql'] = $sql;
$a['mysqli_error'] = mysqli_error($conn);
echo json_encode($a);
